﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UClaimDemageControlList.aspx.cs" Inherits="IHISCETeim.Web.MachineSys.UserModel.UClaimDemageControlList" %>

<form id="pagerForm" method="post" action="UserModel/UClaimDemageControlList.aspx">
<input type="hidden" name="IsJieShan" value="<%=IsJieShan %>" />
    <input type="hidden" name="ShowAgentName" value="<%=ShowAgentName %>" />
<input type="hidden" name="CommonFiled" value="<%=CommonFiled %>" />
<input type="hidden" name="CommonValue" value="<%=CommonValue %>" />
<input type="hidden" name="DiffDuty" value="<%=DiffDuty %>" />
<input type="hidden" name="DownlineDateFrom" value="<%=DownlineDateFrom %>" />
<input type="hidden" name="DownlineDateTo" value="<%=DownlineDateTo %>" />
<input type="hidden" name="orderField" value="<%=orderField %>" />
<input type="hidden" name="orderDirection" value="<%=orderDirection %>" />
<input type="hidden" name="pageNum" value="1" />
<input type="hidden" name="numPerPage" value="<%=numPerPage %>" />
</form>
<style>
    .UClaimDemageList_Row2 td{ border-bottom-width:1px!important; border-bottom-color:#000!important;}
</style>
 <script type="text/javascript">

     //所有已选中的代理商
     var $selectagentname_UClaimDemageControlList = "<%=ShowAgentName %>";
     function UClaimDemageControlListTreeCheck() {
         var json = arguments[0], result = "";
         if (json.checked) {
             $(json.items).each(function (i) {
                 // result += "<p>name:" + this.name + " value:" + this.value + " text: " + this.text + "</p>";
                 $selectagentname_UClaimDemageControlList += this.name + ",";
             });
         }
         else {
             $(json.items).each(function (i) {
                 $selectagentname_UClaimDemageControlList = $selectagentname_UClaimDemageControlList.replace(this.name + ",", "");
             });
         }
         $("#UClaimDemageControlList_ShowAgentName").val($selectagentname_UClaimDemageControlList);
     }
    </script>   
<form id="form1" runat="server" method="post" action="UserModel/UClaimDemageControlList.aspx" onsubmit="return navTabSearch(this);">
<div class="pageContent">    
              
    <div class="searchBar">
        <input type="hidden" id="UClaimDemageControlList_ShowAgentName" name="ShowAgentName" value="<%=ShowAgentName %>" />
        <table class="searchContent">
            <tr>
                <td>
                    <b>查询条件：</b>
                </td>
                <td>
                    <div class="agentlistdiv">
                        <div class="panelBar">
                            <ul class="toolBar"  > 
                                <li style=" float:right;"><a href="#" class="closeselectagent delete"><span>确定选择</span></a></li>
                            </ul>
                        </div>
                        <div class="agentlisttreecon" >                                    
                            <ul class="tree treeCheck" oncheck="UClaimDemageControlListTreeCheck">
                                <%=GetAgentList()%>
                            </ul>
                        </div>
                    </div>
                    <a href="#" class="openselectagent">选择代理商</a>
                </td>                
                <td>
                    <select name="CommonFiled" class="combox">
                        <option value="ClaimsNumber" <%=CommonFiled=="ClaimsNumber"?"selected":"" %>>品情单号</option>
                        <option value="SerialNumber" <%=CommonFiled=="SerialNumber"?"selected":"" %>>机号</option>
                        <option value="PingZhengHao" <%=CommonFiled=="PingZhengHao"?"selected":"" %>>凭证号</option>
                        <%--
                        <option value="ItemCode" <%=CommonFiled=="ItemCode"?"selected":"" %>>物料号</option>
                        <option value="Dscription" <%=CommonFiled=="Dscription"?"selected":"" %>>物料名称</option>
                        <option value="U_InvoiceNum" <%=CommonFiled=="Dscription"?"selected":"" %>>发货单号</option>
                        <option value="InOrderNum" <%=CommonFiled=="InOrderNum"?"selected":"" %>>旧件相关单号</option>--%>
                    </select>
                 </td>
                <td>
                    等于：
                 </td>
                <td>
                    <input name="CommonValue" type="text"  style="width:80px;" value="<%=CommonValue %>" />
                </td>                             
                <td>
                    接到故障日：
                    从<input name="DownlineDateFrom" class="date" type="text" value="<%=DownlineDateFrom %>" style="width:80px;"/>到<input
                        name="DownlineDateTo" type="text" class="date" value="<%=DownlineDateTo %>" style="width:80px;"/>
                </td>
                <td>
                   IHISCE责任:
                    <select name="DiffDuty">
                        <option value="" <%=DiffDuty==""?"selected":""%>>请选择....</option>
                        <option value="厂内组装" <%=DiffDuty=="厂内组装"?"selected":""%>>厂内组装</option>
                        <option value="营业政策性索赔" <%=DiffDuty=="营业政策性索赔"?"selected":""%>>营业政策性索赔</option>
                        <option value="特殊索赔约定" <%=DiffDuty=="特殊索赔约定"?"selected":""%>>特殊索赔约定</option>
                        <option value="其它" <%=DiffDuty=="其它"?"selected":""%>>其它</option>
                    </select>
                </td>
                <td>未结算:
                    <input type="checkbox" name="IsJieShan" <%=IsJieShan?"checked":"" %> value="true" /> 
                </td>
                <td>
                    <div class="subBar">
                        <ul>
                            <li>
                                <div class="buttonActive">
                                    <div class="buttonContent">
                                        <button type="submit">
                                            检索</button></div>
                                </div>
                            </li>
                        </ul>
                    </div>
                </td>
            </tr>                        
        </table>
    </div>
    <div class="panelBar">
        <ul class="toolBar">
            <%if (HasPower(IHISCETeim.Web.Permission.新增))
                {%>
            <li><a class="add" href="UserModel/UClaimDemageControlAdd.aspx" target="dialog" title="添加代理商索赔完成报告单"
                rel="UClaimDemageControlAdd" max="false" mask="true" maxable="false" minable="false" resizable="false"
                drawable="true" width="850" height="450"><span>添加品情单</span></a></li>
            <%} %>
            <%if (HasPower(IHISCETeim.Web.Permission.修改))
                {%>
            <li><a class="edit" href="UserModel/UClaimDemageControlEdit.aspx?ClaimsNumber={sid_user}" target="dialog" title="修改代理商索赔完成报告单"
                rel="UClaimDemageControlEdit" max="false" mask="true" maxable="false" minable="false" resizable="false"
                drawable="true" width="850" height="450"><span>修改品情单</span></a></li>
            <%} %>
            <% if (HasPower(IHISCETeim.Web.Permission.删除))
                {%>
            <li><a class="delete" href="sysAjaxDone.ashx?ajaxmethod=DeleteUClaimDemageControl&ClaimsNumber={sid_user}"
                target="ajaxTodo" title="确定要删除吗?"><span>删除</span></a></li>
            <%} %>
                <% if (HasPower(IHISCETeim.Web.Permission.导出))
                {%>
            <li><a class="icon" href="UserModel/ExportExecl/ExportExeclUClaimDemageControlList.aspx?orderField=<%=orderField %>&orderDirection=<%=orderDirection %>&DownlineDateFrom=<%=DownlineDateFrom %>&DownlineDateTo=<%=DownlineDateTo %>&CommonFiled=<%=CommonFiled %>&CommonValue=<%=CommonValue %>&ShowAgentName=<%= Server.UrlEncode( ShowAgentName) %>&DiffDuty=<%= Server.UrlEncode( DiffDuty)%>" target="_blank" title="确定要导出吗?"><span>导出管控表</span></a></li>
            <%} %>
            <% if (HasPower(IHISCETeim.Web.Permission.索赔管控_索赔录入))
               {%>
            <li><a class="edit" href="UserModel/UClaimDemageControlUpdateSupplerDetail.aspx?ClaimsNumber=" target="navTab" title="索赔录入"
                rel="UClaimDemageControlUpdateSupplerDetail" max="false" mask="true" maxable="false" minable="false" resizable="false"
                drawable="true" width="950" height="450"><span>索赔录入</span></a></li>
            <%} %>
             <% if (HasPower(IHISCETeim.Web.Permission.索赔管控_结算录入))
                {%>
            <li><a class="edit" href="UserModel/UClaimDemageControlUpdateFinalDetail.aspx?ClaimsNumber=" target="navTab" title="结算录入"
                rel="UClaimDemageControlUpdateFinalDetail" max="false" mask="true" maxable="false" minable="false" resizable="false"
                drawable="true" width="950" height="450"><span>结算录入</span></a></li>
            <%} %>
             <% if (HasPower(IHISCETeim.Web.Permission.索赔管控_向供应商索赔统计))
                {%>
            <li><a class="add" href="UserModel/UClaimDemageControlSupplerTongJi.aspx" target="navTab" title="向供应商索赔统计表"
                rel="UClaimDemageControlSupplerTongJi" max="false" mask="true" maxable="false" minable="false" resizable="false"
                drawable="true" width="850" height="450"><span>向供应商索赔统计表</span></a></li>
            <%} %>

            <% if (HasPower(IHISCETeim.Web.Permission.查看))
                {%>
            <li><a class="add" href="UserModel/UClaimDemageControlPaiGong.aspx" target="navTab" title="二次派工占报修比率"
                rel="UClaimDemageControlPaiGong" max="false" mask="true" maxable="false" minable="false" resizable="false"
                drawable="true" width="850" height="450"><span>二次派工占报修比率</span></a></li>
            <%} %>
        </ul>
                   
    </div>
    <table class="list" width="1500px"  layouth="83"  >                                                                                                                <thead>           
        <tr  >        
            <th align="left"  orderField="ClaimsNumber" class="asc" >
                品情单号
            </th>           
            <th  orderField="SerialNumber" class="asc" >
                机号
            </th>            
            <th orderField="FaultDate" class="asc">
                接到故障日
            </th>              
            <th orderField="IntoDate" class="asc">
                交机日期
            </th> 
            <th orderField="AgentName" class="asc">代理商</th>            
            <th  align="center">
                工作小时
            </th> 
            <th width="120px">
                不可索赔件成本
            </th>     
            <th width="130px">
                IHISCE可索赔件成本
            </th>
            <th >发货运费</th>
            <th width="120px">
                代理商结算费用
            </th>
            <th >
                批复时间
            </th>
            <th >
                索赔成本
            </th>
            <th  title="向供应商索赔总金额">
                索赔总金额
            </th>
            <th >
                结算金额
            </th>
            <th >
                索赔成本差异
            </th>
            <th >
                索赔收入差异
            </th>
        </tr>
        </thead>
        <tbody>
    <asp:repeater id="rpMenu" runat="server">
        <HeaderTemplate>       
        
        </HeaderTemplate>
        <ItemTemplate>
        <tr target="sid_user" rel="<%# Eval("ClaimsNumber") %>"> 
            <td>
            <a class="edit" href="UserModel/UClaimDemageControlEdit.aspx?ClaimsNumber=<%# Eval("ClaimsNumber")%>" target="dialog" title="查看索赔完成报告单"
                rel="UClaimDemageControlEdit" max="false" mask="true" maxable="false" minable="false" resizable="false"
                drawable="true" width="850" height="450"><%# Eval("ClaimsNumber")%></a>
            </td>
			<td >
                <a class="add" href="UserModel/UClaimDemageControlList.aspx?CommonFiled=SerialNumber&CommonValue=<%# Eval("SerialNumber")%>" target="navTab" title="机器[<%# Eval("SerialNumber")%>]所有索赔记录"
                rel="UClaimDemageControlList" >  <%# Eval("SerialNumber")%></a>
                </td>          
			<td>
                <%# Convert.ToDateTime(Eval("FaultDate")).ToShortDateString()%>
            </td>
             <td>
                <%# Eval("IntoDate") is DBNull?"": Convert.ToDateTime(Eval("IntoDate")).ToShortDateString()%>
            </td>
            <td ><%# Eval("AgentName")%></td>         
            <td >
                <%# Eval("WorkHour")%>
            </td>
             <td>
                <%# Eval("NotSPSendPartCost")%>
            </td>
            <td>
                <%# Eval("SendPartCost")%>
            </td>
            <td>
                <%# Eval("SendPartTransportCost")%>
            </td>
            <td style="color:<%# Convert.ToBoolean(Eval("AgentIsSubmit"))?"":"red"%>;">
                <%# Convert.ToDecimal(Eval("AgentTotalCost")) - Convert.ToDecimal(Eval("SendPartCost")) - Convert.ToDecimal(Eval("SendPartTransportCost"))%>
            </td>
            <td>
                <%# Eval("PiFuDate")%>
            </td>
             <td >
                <a class="btnEditMoney" href="UserModel/UClaimDemageControlEdit.aspx?ClaimsNumber=<%# Eval("ClaimsNumber") %>" target="dialog" title="修改代理商索赔完成报告单"
                rel="UClaimDemageControlEdit" max="false" mask="true" maxable="false" minable="false" resizable="false"
                drawable="true" width="850" height="450">
                <%# Eval("AgentTotalCost")%>
                </a>
            </td>
             <td >                
                <%# GetUpdateSupplerDetailURL(Eval("ClaimsNumber"),Eval("AgentTotalCost"),Eval("SupplerTotalCostRMB"),1) %>
            </td>
             <td >
                 <%# GetUpdateSupplerDetailURL(Eval("ClaimsNumber"), Eval("SupplerTotalCostRMB"), Eval("FinalTotalCostRMB"), 2)%>
            </td>
             <td  >
                <a class="btnDiffAnalyse" href="UserModel/UClaimDemageControlDiffAnalyse.aspx?ClaimsNumber=<%# Eval("ClaimsNumber") %>" target="dialog" title="[品情单号:<%# Eval("ClaimsNumber") %>]差异分析"
                rel="UClaimDemageControlDiffAnalyse" max="false" mask="true" maxable="false" minable="false" resizable="false"
                drawable="true" width="850" height="320" style="color:<%# GetRedColor(Eval("FinalDiffAnalyse"))%>!important;">
                <%# Eval("FinalDiffAmount")%>
                </a>
              
            </td>
             <td width="9%" >
             <a class="btnDiffAnalyse" href="UserModel/UClaimDemageControlDiffAnalyse.aspx?ClaimsNumber=<%# Eval("ClaimsNumber") %>" target="dialog" title="品情单号:<%# Eval("ClaimsNumber") %>]差异分析"
                rel="UClaimDemageControlDiffAnalyse" max="false" mask="true" maxable="false" minable="false" resizable="false"
                drawable="true" width="850" height="320" style="color:<%# GetRedColor(Eval("SupplerDiffAnalyse"))%>!important;">
                <%# Eval("SupplerDiffAmount")%>
                </a>
                
            </td>
		</tr>
          
        </ItemTemplate>
        <FooterTemplate>  
            <tr class="totalitemtr"  >        
            <td align="left">
                
            </td>           
             
            <td >
                
            </td>            
            <td >
                
            </td>              
            <td></td>
            <td ></td>   
            <td ></td>           
            <td  align="center">
                 总计:
            </td>      
            <td >
                <%=Convert.ToDecimal(GetUMDTValue("SendPartCost")).ToString("F2")%>
            </td>
            
             <td >  <%=Convert.ToDecimal(GetUMDTValue("SendPartTransportCost")).ToString("F2")%></td>
            <td colspan="2">
                 <%=Convert.ToDecimal(GetUMDTValue("AgentTotalCost")) - Convert.ToDecimal(GetUMDTValue("SendPartCost")) - Convert.ToDecimal(GetUMDTValue("SendPartTransportCost"))%>
            </td>
           
            <td >
                <%=Convert.ToDecimal(GetUMDTValue("AgentTotalCost")).ToString("F2")%>
            </td>
            <td  title="向供应商索赔总金额">
                <%=Convert.ToDecimal(GetUMDTValue("SupplerTotalCostRMB")).ToString("F2")%>
            </td>
            <td >
                <%=Convert.ToDecimal(GetUMDTValue("FinalTotalCostRMB")).ToString("F2")%>
            </td>
            <td >
                 <%=Convert.ToDecimal(GetUMDTValue("FinalDiffAmount")).ToString("F2")%>
            </td>
            <td>
                 <%=Convert.ToDecimal(GetUMDTValue("SupplerDiffAmount")).ToString("F2")%>
            </td>
        </tr>       
          
        </FooterTemplate> 
    </asp:repeater>
     </tbody>
   </table>
    <div class="panelBar">
            <div class="pages">
                <span>显示</span>
                <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
                    <%=SetnumPerPage()%>
                </select>
                <span>条，共<%=TotalCount%>条</span>
            </div>
            <div class="pagination" targettype="navTab" totalcount="<%=TotalCount%>" numperpage="<%=numPerPage %>"
                pagenumshown="10" currentpage="<%=pageNum %>">
            </div>
        </div>
</div>
</form>
